/*
 * @Author: wei_jt@ecidi.com
 * @Date: 2019-11-07 09:36:15
 * @LastEditors: wei_jt@ecidi.com
 * @LastEditTime: 2022-01-26 16:41:48
 * @Description: 权限模块接口
 */
import request from '@/utils/request'

/** 新增菜单 */
export function addMenu (data) {
  return request({
    url: '/sys-system/menu',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/** 更新菜单 */
export function saveMenu (data) {
  return request({
    url: '/sys-system/menu',
    method: 'put',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/** 删除菜单 */
export function deleteMenu (id) {
  return request({
    url: '/sys-system/menu',
    method: 'DELETE',
    params: {
      id
    }
  })
}

/** 获取菜单树 */
export function getMenusTree (params) {
  return request({
    url: '/sys-system/menus/tree',
    method: 'get',
    params: params
  })
}

/** 导出菜单 */
export function exportMenu (data) {
  return request({
    url: '/sys-system/menus/export',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}

/** 导入菜单 */
export function importMenu (data) {
  return request({
    url: '/sys-system/menus/import',
    method: 'post',
    data: data,
  })
}